package com.bili.bili_data_api.controller;

import com.bili.bili_data_api.dao.pojo.Guochan;
import com.bili.bili_data_api.dao.pojo.bangumi;
import com.bili.bili_data_api.service.GuoChanService;
import com.bili.bili_data_api.util.Result;
import com.bili.bili_data_api.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("guochan")
public class GuoChanController {

    @Autowired
    private GuoChanService guoChanService;

    //不需要使用，可以删除
    @PostMapping(value = {"getAll"},produces = {"application/json; charset=UTF-8"})
    public GuoChanVo getAll(@RequestBody QueryVo query){
        GuoChanVo all = guoChanService.getAll(query);
        return all;
    }

    @PostMapping(value = {"edit"},produces = {"application/json; charset=UTF-8"})
    public Result edit(@RequestBody GuoChanList guoChanVo){
        return guoChanService.edit(guoChanVo);
    }

    @PostMapping(value = {"delete"},produces = {"application/json; charset=UTF-8"})
    public Result delete(@RequestBody GuoChanList guoChanVo){
        return guoChanService.delete(guoChanVo);
    }

    @PostMapping(value = {"add"},produces = {"application/json; charset=UTF-8"})
    public Result add(@RequestBody Guochan guoChanVo){
        return guoChanService.add(guoChanVo);
    }

    @PostMapping(value = {"selectByTitle"},produces = {"application/json; charset=UTF-8"})
    public GuoChanVo selectByTitle(@RequestBody QueryVo query){
        return guoChanService.selectByTitle(query);
    }
}
